﻿@{
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<html>
<head>
    <script type="text/javascript">
        function ChangePsd() {
            var postdata = {
                curPsd: $("#curPsd").val(),
                newPsd: $("#newPsd").val()
            };
            $.ajax({
                type: "POST",
                url: '/User/SavePassword',
                data: postdata,
                beforeSend: function () {
                    return $('#ff').form('validate');
                },
                success: function (result) {
                    if (result.Success) {
                        $.messager.alert("Message", result.Message);
                        $('#ff').form('clear');
                    } else {
                        $.messager.alert("Message", result.Message);
                    }
                }
            });
        }
    </script>
</head>
<body>
    <div class="easyui-panel" title="My Profile" style="height: 500px" iconCls="icon-ok">
        <div style="padding: 10px 0 10px 60px">
            <form id="ff" method="post">
                <input id="UserId" name="UserId" type="hidden" hidden="true" />
                <table>
                    <tr>
                        <td>Current Password:</td>
                        <td>
                            <input class="easyui-validatebox" id="curPsd" name="CurPsd" type="password" data-options="required:true"></td>
                    </tr>
                    <tr>
                        <td>New Password:</td>
                        <td>
                            <input class="easyui-validatebox" id="newPsd" name="newPsd" type="password" data-options="required:true"></td>
                    </tr>
                    <tr>
                        <td>Confirm Password:</td>
                        <td>
                            <input class="easyui-validatebox" id="conPsd" name="conPsd" type="password" data-options="required:true" validtype="equals['#newPsd']"></td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align:center;padding-top: 10px">
                            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-ok" onclick="ChangePsd()">Save</a>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</body>
</html>

